Net User Command Reference

Most of this is taken from the Net user command reference online at the Microsoft website. I’ve tried to condense and clarify what I could. All commands below assume you are executing them as either a local or domain admin, and are using an administrative cmd prompt when necessary.

The basics

Adding some options

 

Some examples

These all come from http://www.microsoft.com/windows/windows2000/en/advanced/help/net_user__examples.htm

 

A few notes:

  1. User accounts cannot have more than twenty characters in their name. Domain accounts will always be created in the CN=Users container unless you changed the default through GPO. They will not have a UPN until you go into ADUC to create one. They will not have any other attributes populated unless you specify them using options.
  2. The ‘password’ option assigns or changes a password for the user’s account. A password must satisfy the requirements of the local machine or the domain.
  3. The ‘/domain’ option performs the operation on any one domain controller of the computer’s primary domain, not the user’s. This will not necessarily be the PDCe, logon server, or even a server in your site.
  4. All options can be omitted if the defaults are desired.
  5. All of the above commands can be used in a simple cmd file, but if you do, all variables must be offset by double percent signs
    eg. for /f %%I in (c:\scratch\users.txt) do net user %%I /active:no /domain